package routes

const (
	RCODE_OK         = "0"
	RCODE_PARAMERR   = "1"
	RCODE_LOGINERR   = "2"
	RCODE_BCKERR     = "3"
	RCODE_UNKNOWNERR = "4"
)

var msgMap map[string]string

//自动初始化部分
func init() {
	msgMap = make(map[string]string)
	msgMap[RCODE_OK] = "成功"
	msgMap[RCODE_PARAMERR] = "参数异常"
	msgMap[RCODE_LOGINERR] = "登陆异常"
	msgMap[RCODE_BCKERR] = "区块链调用异常"
	msgMap[RCODE_UNKNOWNERR] = "未知异常"

}

func GetCodeMsg(code string) string {
	return msgMap[code]
}

type RespInfo struct {
	Code string      `json:"code"`
	Msg  string      `json:"msg"`
	Data interface{} `json:"data"`
}
